import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/main',
    name: 'Main',
    component: () => import('../views/Main.vue'),
    redirect: '/welcome',
    children: [
      {
        path: '/users',
        name: 'Users',
        component: () => import('../views/user/Users.vue')
      },
      {
        path: '/roles',
        name: 'Roles',
        component: () => import('../views/roles/Roles.vue'),
      },
      {
        path: '/welcome',
        name: 'Welcome',
        component: () => import('../views/Welcome.vue'),
      },
      {
        path: '/icons',
        name: 'Icons',
        component: () => import('../views/doc/Icons.vue'),
      },
      {
        path: '/outStocks',
        component: () => import('../views/product/OutStocks.vue')
      },
      {
        path: '/OutStocks/publishStocks',
        name: 'OutStocks',
        component: () => import('../views/product/PublishStocks.vue')
      },
      {
        path: '/inStocks',
        component: () => import('../views/product/InStocks.vue'),
      },
      {
        path: '/productCategorys',
        component: () => import('../views/product/ProductCategorys.vue'),
      },
      {
        path: '/attachments',
        component: () => import('../views/doc/Attachments.vue')
      },
      {
        path: '/products',
        component: () => import('../views/product/Products.vue'),
      },
      {
        path: '/stocks',
        component:  () => import('../views/product/stocks.vue')
      },
      {
        path: '/health',
        component: () => import('../views/user/Health.vue')
      },
      {
        path: '/menus',
        component: () => import('../views/menu/Menus.vue')
      },
      , {
        path: '/inStocks/addStocks',
        component: () => import('../views/product/AddStocks.vue')
      },
      {
        path: '/consumers',
        component: () => import('../views/product/Consumers.vue')
      },
      {
        path: '/loginLog',
        component: () => import('../views/log/LoginLog.vue')
      },
      {
        path: '/map',
        component:  () => import('../views/doc/Map.vue')
      },
      {
        path: '/suppliers',
        component: () => import('../views/product/Suppliers.vue')
      },
      {
        path: '/logs',
        component: () => import('../views/log/logs.vue')
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
